<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998


Matching guarded right-hand-sides (GRHSs)
-}</span><span>
</span><span id="line-8"></span><span>
</span><span id="line-9"></span><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-10"></span><span class="hs-pragma">{-# LANGUAGE ViewPatterns #-}</span><span>
</span><span id="line-11"></span><span>
</span><span id="line-12"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.HsToCore.GuardedRHSs</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.HsToCore.GuardedRHSs.html#dsGuarded"><span class="hs-identifier">dsGuarded</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.GuardedRHSs.html#dsGRHSs"><span class="hs-identifier">dsGRHSs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Utils.html#isTrueLHsExpr"><span class="hs-identifier">isTrueLHsExpr</span></a></span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-16"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-17"></span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="hs-pragma">{-# SOURCE</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><a href="GHC.HsToCore.Expr.html"><span class="hs-identifier">GHC.HsToCore.Expr</span></a></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier">dsLExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Expr.html#dsLocalBinds"><span class="hs-identifier">dsLocalBinds</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="hs-pragma">{-# SOURCE</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html"><span class="hs-identifier">GHC.HsToCore.Match</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html#matchSinglePatVar"><span class="hs-identifier">matchSinglePatVar</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-20"></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Hs.html"><span class="hs-identifier">GHC.Hs</span></a></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Make.html"><span class="hs-identifier">GHC.Core.Make</span></a></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.html"><span class="hs-identifier">GHC.Core</span></a></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Utils.html"><span class="hs-identifier">GHC.Core.Utils</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Utils.html#bindNonRec"><span class="hs-identifier">bindNonRec</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-25"></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html"><span class="hs-identifier">GHC.HsToCore.Monad</span></a></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Utils.html"><span class="hs-identifier">GHC.HsToCore.Utils</span></a></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html"><span class="hs-identifier">GHC.HsToCore.PmCheck.Types</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Deltas"><span class="hs-identifier">Deltas</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#initDeltas"><span class="hs-identifier">initDeltas</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier">Type</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Multiplicity.html"><span class="hs-identifier">GHC.Core.Multiplicity</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#zipWithM"><span class="hs-identifier">zipWithM</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.NonEmpty.html#"><span class="hs-identifier">Data.List.NonEmpty</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier">NonEmpty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.List.NonEmpty.html#toList"><span class="hs-identifier">toList</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-36"></span><span>
</span><span id="line-37"></span><span class="hs-comment">{-
@dsGuarded@ is used for pattern bindings.
It desugars:
\begin{verbatim}
        | g1 -&gt; e1
        ...
        | gn -&gt; en
        where binds
\end{verbatim}
producing an expression with a runtime error in the corner if
necessary.  The type argument gives the type of the @ei@.
-}</span><span>
</span><span id="line-49"></span><span>
</span><span id="line-50"></span><span class="annot"><a href="GHC.HsToCore.GuardedRHSs.html#dsGuarded"><span class="hs-identifier hs-type">dsGuarded</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#GRHSs"><span class="hs-identifier hs-type">GRHSs</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Deltas"><span class="hs-identifier hs-type">Deltas</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-51"></span><span id="dsGuarded"><span class="annot"><span class="annottext">dsGuarded :: GRHSs GhcTc (LHsExpr GhcTc)
-&gt; Type -&gt; Maybe (NonEmpty Deltas) -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.GuardedRHSs.html#dsGuarded"><span class="hs-identifier hs-var hs-var">dsGuarded</span></a></span></span><span> </span><span id="local-6989586621681149999"><span class="annot"><span class="annottext">GRHSs GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681149999"><span class="hs-identifier hs-var">grhss</span></a></span></span><span> </span><span id="local-6989586621681149998"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681149998"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span> </span><span id="local-6989586621681149997"><span class="annot"><span class="annottext">Maybe (NonEmpty Deltas)
</span><a href="#local-6989586621681149997"><span class="hs-identifier hs-var">mb_rhss_deltas</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-52"></span><span>    </span><span id="local-6989586621681149996"><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681149996"><span class="hs-identifier hs-var">match_result</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; GRHSs GhcTc (LHsExpr GhcTc)
-&gt; Type
-&gt; Maybe (NonEmpty Deltas)
-&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.GuardedRHSs.html#dsGRHSs"><span class="hs-identifier hs-var">dsGRHSs</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
forall p. HsMatchContext p
</span><a href="GHC.Hs.Expr.html#PatBindRhs"><span class="hs-identifier hs-var">PatBindRhs</span></a></span><span> </span><span class="annot"><span class="annottext">GRHSs GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681149999"><span class="hs-identifier hs-var">grhss</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681149998"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (NonEmpty Deltas)
</span><a href="#local-6989586621681149997"><span class="hs-identifier hs-var">mb_rhss_deltas</span></a></span><span>
</span><span id="line-53"></span><span>    </span><span id="local-6989586621681149994"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149994"><span class="hs-identifier hs-var">error_expr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Type -&gt; SDoc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Utils.html#mkErrorAppDs"><span class="hs-identifier hs-var">mkErrorAppDs</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#nON_EXHAUSTIVE_GUARDS_ERROR_ID"><span class="hs-identifier hs-var">nON_EXHAUSTIVE_GUARDS_ERROR_ID</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681149998"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-54"></span><span>    </span><span class="annot"><span class="annottext">MatchResult CoreExpr -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Utils.html#extractMatchResult"><span class="hs-identifier hs-var">extractMatchResult</span></a></span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681149996"><span class="hs-identifier hs-var">match_result</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149994"><span class="hs-identifier hs-var">error_expr</span></a></span><span>
</span><span id="line-55"></span><span>
</span><span id="line-56"></span><span class="hs-comment">-- In contrast, @dsGRHSs@ produces a @MatchResult CoreExpr@.</span><span>
</span><span id="line-57"></span><span>
</span><span id="line-58"></span><span class="annot"><a href="GHC.HsToCore.GuardedRHSs.html#dsGRHSs"><span class="hs-identifier hs-type">dsGRHSs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsMatchContext"><span class="hs-identifier hs-type">HsMatchContext</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>
</span><span id="line-59"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#GRHSs"><span class="hs-identifier hs-type">GRHSs</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ Guarded RHSs</span><span>
</span><span id="line-60"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>                        </span><span class="hs-comment">-- ^ Type of RHS</span><span>
</span><span id="line-61"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Deltas"><span class="hs-identifier hs-type">Deltas</span></a></span><span class="hs-special">)</span><span>     </span><span class="hs-comment">-- ^ Refined pattern match checking</span><span>
</span><span id="line-62"></span><span>                                       </span><span class="hs-comment">--   models, one for each GRHS. Defaults</span><span>
</span><span id="line-63"></span><span>                                       </span><span class="hs-comment">--   to 'initDeltas' if 'Nothing'.</span><span>
</span><span id="line-64"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#MatchResult"><span class="hs-identifier hs-type">MatchResult</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-65"></span><span id="dsGRHSs"><span class="annot"><span class="annottext">dsGRHSs :: HsMatchContext GhcRn
-&gt; GRHSs GhcTc (LHsExpr GhcTc)
-&gt; Type
-&gt; Maybe (NonEmpty Deltas)
-&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.GuardedRHSs.html#dsGRHSs"><span class="hs-identifier hs-var hs-var">dsGRHSs</span></a></span></span><span> </span><span id="local-6989586621681149989"><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681149989"><span class="hs-identifier hs-var">hs_ctx</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#GRHSs"><span class="hs-identifier hs-type">GRHSs</span></a></span><span> </span><span class="annot"><span class="annottext">XCGRHSs GhcTc (LHsExpr GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681149987"><span class="annot"><span class="annottext">[LGRHS GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681149987"><span class="hs-identifier hs-var">grhss</span></a></span></span><span> </span><span id="local-6989586621681149986"><span class="annot"><span class="annottext">LHsLocalBinds GhcTc
</span><a href="#local-6989586621681149986"><span class="hs-identifier hs-var">binds</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681149985"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681149985"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span> </span><span id="local-6989586621681149984"><span class="annot"><span class="annottext">Maybe (NonEmpty Deltas)
</span><a href="#local-6989586621681149984"><span class="hs-identifier hs-var">mb_rhss_deltas</span></a></span></span><span>
</span><span id="line-66"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">notNull</span><span> </span><span class="hs-identifier">grhss</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-67"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681149978"><span class="annot"><span class="annottext">[MatchResult CoreExpr]
</span><a href="#local-6989586621681149978"><span class="hs-identifier hs-var">match_results</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">NonEmpty Deltas -&gt; [Deltas]
forall a. NonEmpty a -&gt; [a]
</span><a href="../../base/src/Data.List.NonEmpty.html#toList"><span class="hs-identifier hs-var">toList</span></a></span><span> </span><span class="annot"><span class="annottext">(NonEmpty Deltas -&gt; [Deltas])
-&gt; Maybe (NonEmpty Deltas) -&gt; Maybe [Deltas]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (NonEmpty Deltas)
</span><a href="#local-6989586621681149984"><span class="hs-identifier hs-var">mb_rhss_deltas</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-68"></span><span>           </span><span class="annot"><span class="annottext">Maybe [Deltas]
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(LGRHS GhcTc (LHsExpr GhcTc) -&gt; DsM (MatchResult CoreExpr))
-&gt; [LGRHS GhcTc (LHsExpr GhcTc)]
-&gt; IOEnv (Env DsGblEnv DsLclEnv) [MatchResult CoreExpr]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span>     </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; Type
-&gt; Deltas
-&gt; LGRHS GhcTc (LHsExpr GhcTc)
-&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.GuardedRHSs.html#dsGRHS"><span class="hs-identifier hs-var">dsGRHS</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681149989"><span class="hs-identifier hs-var">hs_ctx</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681149985"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Deltas
</span><a href="GHC.HsToCore.PmCheck.Types.html#initDeltas"><span class="hs-identifier hs-var">initDeltas</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LGRHS GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681149987"><span class="hs-identifier hs-var">grhss</span></a></span><span>
</span><span id="line-69"></span><span>           </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681149974"><span class="annot"><span class="annottext">[Deltas]
</span><a href="#local-6989586621681149974"><span class="hs-identifier hs-var">rhss_deltas</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">length</span><span> </span><span class="hs-identifier">grhss</span><span> </span><span class="hs-operator">==</span><span> </span><span class="hs-identifier">length</span><span> </span><span class="hs-identifier">rhss_deltas</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-70"></span><span>                               </span><span class="annot"><span class="annottext">(Deltas
 -&gt; LGRHS GhcTc (LHsExpr GhcTc) -&gt; DsM (MatchResult CoreExpr))
-&gt; [Deltas]
-&gt; [LGRHS GhcTc (LHsExpr GhcTc)]
-&gt; IOEnv (Env DsGblEnv DsLclEnv) [MatchResult CoreExpr]
forall (m :: * -&gt; *) a b c.
Applicative m =&gt;
(a -&gt; b -&gt; m c) -&gt; [a] -&gt; [b] -&gt; m [c]
</span><a href="../../base/src/Control.Monad.html#zipWithM"><span class="hs-identifier hs-var">zipWithM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; Type
-&gt; Deltas
-&gt; LGRHS GhcTc (LHsExpr GhcTc)
-&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.GuardedRHSs.html#dsGRHS"><span class="hs-identifier hs-var">dsGRHS</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681149989"><span class="hs-identifier hs-var">hs_ctx</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681149985"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Deltas]
</span><a href="#local-6989586621681149974"><span class="hs-identifier hs-var">rhss_deltas</span></a></span><span> </span><span class="annot"><span class="annottext">[LGRHS GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681149987"><span class="hs-identifier hs-var">grhss</span></a></span><span>
</span><span id="line-71"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681149971"><span class="annot"><span class="annottext">match_result1 :: MatchResult CoreExpr
</span><a href="#local-6989586621681149971"><span class="hs-identifier hs-var hs-var">match_result1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(MatchResult CoreExpr
 -&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr)
-&gt; [MatchResult CoreExpr] -&gt; MatchResult CoreExpr
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; a -&gt; a) -&gt; t a -&gt; a
</span><a href="../../base/src/Data.Foldable.html#foldr1"><span class="hs-identifier hs-var">foldr1</span></a></span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
-&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr
</span><a href="GHC.HsToCore.Utils.html#combineMatchResults"><span class="hs-identifier hs-var">combineMatchResults</span></a></span><span> </span><span class="annot"><span class="annottext">[MatchResult CoreExpr]
</span><a href="#local-6989586621681149978"><span class="hs-identifier hs-var">match_results</span></a></span><span>
</span><span id="line-72"></span><span>             </span><span id="local-6989586621681149968"><span class="annot"><span class="annottext">match_result2 :: MatchResult CoreExpr
</span><a href="#local-6989586621681149968"><span class="hs-identifier hs-var hs-var">match_result2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; DsM CoreExpr)
-&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr
forall a b. (a -&gt; DsM b) -&gt; MatchResult a -&gt; MatchResult b
</span><a href="GHC.HsToCore.Utils.html#adjustMatchResultDs"><span class="hs-identifier hs-var">adjustMatchResultDs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsLocalBinds GhcTc -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLocalBinds"><span class="hs-identifier hs-var">dsLocalBinds</span></a></span><span> </span><span class="annot"><span class="annottext">LHsLocalBinds GhcTc
</span><a href="#local-6989586621681149986"><span class="hs-identifier hs-var">binds</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681149971"><span class="hs-identifier hs-var">match_result1</span></a></span><span>
</span><span id="line-73"></span><span>                             </span><span class="hs-comment">-- NB: nested dsLet inside matchResult</span><span>
</span><span id="line-74"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr -&gt; DsM (MatchResult CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681149968"><span class="hs-identifier hs-var">match_result2</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-75"></span><span>
</span><span id="line-76"></span><span class="annot"><a href="GHC.HsToCore.GuardedRHSs.html#dsGRHS"><span class="hs-identifier hs-type">dsGRHS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsMatchContext"><span class="hs-identifier hs-type">HsMatchContext</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Deltas"><span class="hs-identifier hs-type">Deltas</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LGRHS"><span class="hs-identifier hs-type">LGRHS</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-77"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#MatchResult"><span class="hs-identifier hs-type">MatchResult</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-78"></span><span id="dsGRHS"><span class="annot"><span class="annottext">dsGRHS :: HsMatchContext GhcRn
-&gt; Type
-&gt; Deltas
-&gt; LGRHS GhcTc (LHsExpr GhcTc)
-&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.GuardedRHSs.html#dsGRHS"><span class="hs-identifier hs-var hs-var">dsGRHS</span></a></span></span><span> </span><span id="local-6989586621681149966"><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681149966"><span class="hs-identifier hs-var">hs_ctx</span></a></span></span><span> </span><span id="local-6989586621681149965"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681149965"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span> </span><span id="local-6989586621681149964"><span class="annot"><span class="annottext">Deltas
</span><a href="#local-6989586621681149964"><span class="hs-identifier hs-var">rhs_deltas</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#GRHS"><span class="hs-identifier hs-type">GRHS</span></a></span><span> </span><span class="annot"><span class="annottext">XCGRHS GhcTc (LHsExpr GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681149961"><span class="annot"><span class="annottext">[GuardLStmt GhcTc]
</span><a href="#local-6989586621681149961"><span class="hs-identifier hs-var">guards</span></a></span></span><span> </span><span id="local-6989586621681149960"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681149960"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-79"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Deltas -&gt; DsM (MatchResult CoreExpr) -&gt; DsM (MatchResult CoreExpr)
forall a. Deltas -&gt; DsM a -&gt; DsM a
</span><a href="GHC.HsToCore.Monad.html#updPmDeltas"><span class="hs-identifier hs-var">updPmDeltas</span></a></span><span> </span><span class="annot"><span class="annottext">Deltas
</span><a href="#local-6989586621681149964"><span class="hs-identifier hs-var">rhs_deltas</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[GuardStmt GhcTc]
-&gt; HsStmtContext GhcRn
-&gt; LHsExpr GhcTc
-&gt; Type
-&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.GuardedRHSs.html#matchGuards"><span class="hs-identifier hs-var">matchGuards</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(GuardLStmt GhcTc -&gt; GuardStmt GhcTc)
-&gt; [GuardLStmt GhcTc] -&gt; [GuardStmt GhcTc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">GuardLStmt GhcTc -&gt; GuardStmt GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">[GuardLStmt GhcTc]
</span><a href="#local-6989586621681149961"><span class="hs-identifier hs-var">guards</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsMatchContext GhcRn -&gt; HsStmtContext GhcRn
forall p. HsMatchContext p -&gt; HsStmtContext p
</span><a href="GHC.Hs.Expr.html#PatGuard"><span class="hs-identifier hs-var">PatGuard</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681149966"><span class="hs-identifier hs-var">hs_ctx</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681149960"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681149965"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-80"></span><span>
</span><span id="line-81"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
*  matchGuard : make a MatchResult CoreExpr CoreExpr from a guarded RHS                  *
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-88"></span><span>
</span><span id="line-89"></span><span class="annot"><a href="GHC.HsToCore.GuardedRHSs.html#matchGuards"><span class="hs-identifier hs-type">matchGuards</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#GuardStmt"><span class="hs-identifier hs-type">GuardStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">]</span><span>     </span><span class="hs-comment">-- Guard</span><span>
</span><span id="line-90"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsStmtContext"><span class="hs-identifier hs-type">HsStmtContext</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>   </span><span class="hs-comment">-- Context</span><span>
</span><span id="line-91"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>         </span><span class="hs-comment">-- RHS</span><span>
</span><span id="line-92"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>                  </span><span class="hs-comment">-- Type of RHS of guard</span><span>
</span><span id="line-93"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#MatchResult"><span class="hs-identifier hs-type">MatchResult</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-94"></span><span>
</span><span id="line-95"></span><span class="hs-comment">-- See comments with HsExpr.Stmt re what a BodyStmt means</span><span>
</span><span id="line-96"></span><span class="hs-comment">-- Here we must be in a guard context (not do-expression, nor list-comp)</span><span>
</span><span id="line-97"></span><span>
</span><span id="line-98"></span><span id="matchGuards"><span class="annot"><span class="annottext">matchGuards :: [GuardStmt GhcTc]
-&gt; HsStmtContext GhcRn
-&gt; LHsExpr GhcTc
-&gt; Type
-&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.GuardedRHSs.html#matchGuards"><span class="hs-identifier hs-var hs-var">matchGuards</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681149955"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681149955"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-99"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681149954"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149954"><span class="hs-identifier hs-var">core_rhs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681149955"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-100"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr -&gt; DsM (MatchResult CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; MatchResult CoreExpr
</span><a href="GHC.HsToCore.Utils.html#cantFailMatchResult"><span class="hs-identifier hs-var">cantFailMatchResult</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149954"><span class="hs-identifier hs-var">core_rhs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-101"></span><span>
</span><span id="line-102"></span><span>        </span><span class="hs-comment">-- BodyStmts must be guards</span><span>
</span><span id="line-103"></span><span>        </span><span class="hs-comment">-- Turn an &quot;otherwise&quot; guard is a no-op.  This ensures that</span><span>
</span><span id="line-104"></span><span>        </span><span class="hs-comment">-- you don't get a &quot;non-exhaustive eqns&quot; message when the guards</span><span>
</span><span id="line-105"></span><span>        </span><span class="hs-comment">-- finish in &quot;otherwise&quot;.</span><span>
</span><span id="line-106"></span><span>        </span><span class="hs-comment">-- NB:  The success of this clause depends on the typechecker not</span><span>
</span><span id="line-107"></span><span>        </span><span class="hs-comment">--      wrapping the 'otherwise' in empty HsTyApp or HsWrap constructors</span><span>
</span><span id="line-108"></span><span>        </span><span class="hs-comment">--      If it does, you'll get bogus overlap warnings</span><span>
</span><span id="line-109"></span><span class="annot"><a href="GHC.HsToCore.GuardedRHSs.html#matchGuards"><span class="hs-identifier hs-var">matchGuards</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#BodyStmt"><span class="hs-identifier hs-type">BodyStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XBodyStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681149951"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681149951"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681149950"><span class="annot"><span class="annottext">[GuardStmt GhcTc]
</span><a href="#local-6989586621681149950"><span class="hs-identifier hs-var">stmts</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681149949"><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681149949"><span class="hs-identifier hs-var">ctx</span></a></span></span><span> </span><span id="local-6989586621681149948"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681149948"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span id="local-6989586621681149947"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681149947"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span>
</span><span id="line-110"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681149946"><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
</span><a href="#local-6989586621681149946"><span class="hs-identifier hs-var">addTicks</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; Maybe (CoreExpr -&gt; DsM CoreExpr)
</span><a href="GHC.HsToCore.Utils.html#isTrueLHsExpr"><span class="hs-identifier hs-var">isTrueLHsExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681149951"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-111"></span><span>    </span><span id="local-6989586621681149945"><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681149945"><span class="hs-identifier hs-var">match_result</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[GuardStmt GhcTc]
-&gt; HsStmtContext GhcRn
-&gt; LHsExpr GhcTc
-&gt; Type
-&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.GuardedRHSs.html#matchGuards"><span class="hs-identifier hs-var">matchGuards</span></a></span><span> </span><span class="annot"><span class="annottext">[GuardStmt GhcTc]
</span><a href="#local-6989586621681149950"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681149949"><span class="hs-identifier hs-var">ctx</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681149948"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681149947"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span>
</span><span id="line-112"></span><span>    </span><span class="annot"><span class="annottext">MatchResult CoreExpr -&gt; DsM (MatchResult CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(CoreExpr -&gt; DsM CoreExpr)
-&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr
forall a b. (a -&gt; DsM b) -&gt; MatchResult a -&gt; MatchResult b
</span><a href="GHC.HsToCore.Utils.html#adjustMatchResultDs"><span class="hs-identifier hs-var">adjustMatchResultDs</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
</span><a href="#local-6989586621681149946"><span class="hs-identifier hs-var">addTicks</span></a></span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681149945"><span class="hs-identifier hs-var">match_result</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-113"></span><span class="annot"><a href="GHC.HsToCore.GuardedRHSs.html#matchGuards"><span class="hs-identifier hs-var">matchGuards</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#BodyStmt"><span class="hs-identifier hs-type">BodyStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XBodyStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681149944"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681149944"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681149943"><span class="annot"><span class="annottext">[GuardStmt GhcTc]
</span><a href="#local-6989586621681149943"><span class="hs-identifier hs-var">stmts</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681149942"><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681149942"><span class="hs-identifier hs-var">ctx</span></a></span></span><span> </span><span id="local-6989586621681149941"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681149941"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span id="local-6989586621681149940"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681149940"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-114"></span><span>    </span><span id="local-6989586621681149939"><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681149939"><span class="hs-identifier hs-var">match_result</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[GuardStmt GhcTc]
-&gt; HsStmtContext GhcRn
-&gt; LHsExpr GhcTc
-&gt; Type
-&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.GuardedRHSs.html#matchGuards"><span class="hs-identifier hs-var">matchGuards</span></a></span><span> </span><span class="annot"><span class="annottext">[GuardStmt GhcTc]
</span><a href="#local-6989586621681149943"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681149942"><span class="hs-identifier hs-var">ctx</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681149941"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681149940"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span>
</span><span id="line-115"></span><span>    </span><span id="local-6989586621681149938"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149938"><span class="hs-identifier hs-var">pred_expr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681149944"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-116"></span><span>    </span><span class="annot"><span class="annottext">MatchResult CoreExpr -&gt; DsM (MatchResult CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr
</span><a href="GHC.HsToCore.Utils.html#mkGuardedMatchResult"><span class="hs-identifier hs-var">mkGuardedMatchResult</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149938"><span class="hs-identifier hs-var">pred_expr</span></a></span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681149939"><span class="hs-identifier hs-var">match_result</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-117"></span><span>
</span><span id="line-118"></span><span class="annot"><a href="GHC.HsToCore.GuardedRHSs.html#matchGuards"><span class="hs-identifier hs-var">matchGuards</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LetStmt"><span class="hs-identifier hs-type">LetStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XLetStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681149935"><span class="annot"><span class="annottext">LHsLocalBinds GhcTc
</span><a href="#local-6989586621681149935"><span class="hs-identifier hs-var">binds</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681149934"><span class="annot"><span class="annottext">[GuardStmt GhcTc]
</span><a href="#local-6989586621681149934"><span class="hs-identifier hs-var">stmts</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681149933"><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681149933"><span class="hs-identifier hs-var">ctx</span></a></span></span><span> </span><span id="local-6989586621681149932"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681149932"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span id="local-6989586621681149931"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681149931"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-119"></span><span>    </span><span id="local-6989586621681149930"><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681149930"><span class="hs-identifier hs-var">match_result</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[GuardStmt GhcTc]
-&gt; HsStmtContext GhcRn
-&gt; LHsExpr GhcTc
-&gt; Type
-&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.GuardedRHSs.html#matchGuards"><span class="hs-identifier hs-var">matchGuards</span></a></span><span> </span><span class="annot"><span class="annottext">[GuardStmt GhcTc]
</span><a href="#local-6989586621681149934"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681149933"><span class="hs-identifier hs-var">ctx</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681149932"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681149931"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span>
</span><span id="line-120"></span><span>    </span><span class="annot"><span class="annottext">MatchResult CoreExpr -&gt; DsM (MatchResult CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(CoreExpr -&gt; DsM CoreExpr)
-&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr
forall a b. (a -&gt; DsM b) -&gt; MatchResult a -&gt; MatchResult b
</span><a href="GHC.HsToCore.Utils.html#adjustMatchResultDs"><span class="hs-identifier hs-var">adjustMatchResultDs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsLocalBinds GhcTc -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLocalBinds"><span class="hs-identifier hs-var">dsLocalBinds</span></a></span><span> </span><span class="annot"><span class="annottext">LHsLocalBinds GhcTc
</span><a href="#local-6989586621681149935"><span class="hs-identifier hs-var">binds</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681149930"><span class="hs-identifier hs-var">match_result</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-121"></span><span>        </span><span class="hs-comment">-- NB the dsLet occurs inside the match_result</span><span>
</span><span id="line-122"></span><span>        </span><span class="hs-comment">-- Reason: dsLet takes the body expression as its argument</span><span>
</span><span id="line-123"></span><span>        </span><span class="hs-comment">--         so we can't desugar the bindings without the</span><span>
</span><span id="line-124"></span><span>        </span><span class="hs-comment">--         body expression in hand</span><span>
</span><span id="line-125"></span><span>
</span><span id="line-126"></span><span class="annot"><a href="GHC.HsToCore.GuardedRHSs.html#matchGuards"><span class="hs-identifier hs-var">matchGuards</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#BindStmt"><span class="hs-identifier hs-type">BindStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XBindStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681149928"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681149928"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621681149927"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681149927"><span class="hs-identifier hs-var">bind_rhs</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681149926"><span class="annot"><span class="annottext">[GuardStmt GhcTc]
</span><a href="#local-6989586621681149926"><span class="hs-identifier hs-var">stmts</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681149925"><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681149925"><span class="hs-identifier hs-var">ctx</span></a></span></span><span> </span><span id="local-6989586621681149924"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681149924"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span id="local-6989586621681149923"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681149923"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-127"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681149922"><span class="annot"><span class="annottext">upat :: Pat GhcTc
</span><a href="#local-6989586621681149922"><span class="hs-identifier hs-var hs-var">upat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc) -&gt; Pat GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681149928"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-128"></span><span>    </span><span id="local-6989586621681149921"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681149921"><span class="hs-identifier hs-var">match_var</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Pat GhcTc -&gt; DsM Id
</span><a href="GHC.HsToCore.Utils.html#selectMatchVar"><span class="hs-identifier hs-var">selectMatchVar</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681149922"><span class="hs-identifier hs-var">upat</span></a></span><span>
</span><span id="line-129"></span><span>       </span><span class="hs-comment">-- We only allow unrestricted patterns in guard, hence the `Many`</span><span>
</span><span id="line-130"></span><span>       </span><span class="hs-comment">-- above. It isn't clear what linear patterns would mean, maybe we will</span><span>
</span><span id="line-131"></span><span>       </span><span class="hs-comment">-- figure it out in the future.</span><span>
</span><span id="line-132"></span><span>
</span><span id="line-133"></span><span>    </span><span id="local-6989586621681149918"><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681149918"><span class="hs-identifier hs-var">match_result</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[GuardStmt GhcTc]
-&gt; HsStmtContext GhcRn
-&gt; LHsExpr GhcTc
-&gt; Type
-&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.GuardedRHSs.html#matchGuards"><span class="hs-identifier hs-var">matchGuards</span></a></span><span> </span><span class="annot"><span class="annottext">[GuardStmt GhcTc]
</span><a href="#local-6989586621681149926"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681149925"><span class="hs-identifier hs-var">ctx</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681149924"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681149923"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span>
</span><span id="line-134"></span><span>    </span><span id="local-6989586621681149917"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149917"><span class="hs-identifier hs-var">core_rhs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681149927"><span class="hs-identifier hs-var">bind_rhs</span></a></span><span>
</span><span id="line-135"></span><span>    </span><span id="local-6989586621681149916"><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681149916"><span class="hs-identifier hs-var">match_result'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id
-&gt; HsMatchContext GhcRn
-&gt; LPat GhcTc
-&gt; Type
-&gt; MatchResult CoreExpr
-&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#matchSinglePatVar"><span class="hs-identifier hs-var">matchSinglePatVar</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681149921"><span class="hs-identifier hs-var">match_var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsStmtContext GhcRn -&gt; HsMatchContext GhcRn
forall p. HsStmtContext p -&gt; HsMatchContext p
</span><a href="GHC.Hs.Expr.html#StmtCtxt"><span class="hs-identifier hs-var">StmtCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681149925"><span class="hs-identifier hs-var">ctx</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681149928"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681149923"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span>
</span><span id="line-136"></span><span>                                       </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681149918"><span class="hs-identifier hs-var">match_result</span></a></span><span>
</span><span id="line-137"></span><span>    </span><span class="annot"><span class="annottext">MatchResult CoreExpr -&gt; DsM (MatchResult CoreExpr)
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">(MatchResult CoreExpr -&gt; DsM (MatchResult CoreExpr))
-&gt; MatchResult CoreExpr -&gt; DsM (MatchResult CoreExpr)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Utils.html#bindNonRec"><span class="hs-identifier hs-var">bindNonRec</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681149921"><span class="hs-identifier hs-var">match_var</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149917"><span class="hs-identifier hs-var">core_rhs</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr)
-&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681149916"><span class="hs-identifier hs-var">match_result'</span></a></span><span>
</span><span id="line-138"></span><span>
</span><span id="line-139"></span><span class="annot"><a href="GHC.HsToCore.GuardedRHSs.html#matchGuards"><span class="hs-identifier hs-var">matchGuards</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LastStmt"><span class="hs-identifier hs-type">LastStmt</span></a></span><span>  </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">[GuardStmt GhcTc]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; DsM (MatchResult CoreExpr)
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;matchGuards LastStmt&quot;</span></span><span>
</span><span id="line-140"></span><span class="annot"><a href="GHC.HsToCore.GuardedRHSs.html#matchGuards"><span class="hs-identifier hs-var">matchGuards</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ParStmt"><span class="hs-identifier hs-type">ParStmt</span></a></span><span>   </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">[GuardStmt GhcTc]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; DsM (MatchResult CoreExpr)
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;matchGuards ParStmt&quot;</span></span><span>
</span><span id="line-141"></span><span class="annot"><a href="GHC.HsToCore.GuardedRHSs.html#matchGuards"><span class="hs-identifier hs-var">matchGuards</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#TransStmt"><span class="hs-identifier hs-type">TransStmt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">[GuardStmt GhcTc]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; DsM (MatchResult CoreExpr)
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;matchGuards TransStmt&quot;</span></span><span>
</span><span id="line-142"></span><span class="annot"><a href="GHC.HsToCore.GuardedRHSs.html#matchGuards"><span class="hs-identifier hs-var">matchGuards</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#RecStmt"><span class="hs-identifier hs-type">RecStmt</span></a></span><span>   </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">[GuardStmt GhcTc]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; DsM (MatchResult CoreExpr)
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;matchGuards RecStmt&quot;</span></span><span>
</span><span id="line-143"></span><span class="annot"><a href="GHC.HsToCore.GuardedRHSs.html#matchGuards"><span class="hs-identifier hs-var">matchGuards</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ApplicativeStmt"><span class="hs-identifier hs-type">ApplicativeStmt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">[GuardStmt GhcTc]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-144"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; DsM (MatchResult CoreExpr)
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;matchGuards ApplicativeLastStmt&quot;</span></span><span>
</span><span id="line-145"></span><span>
</span><span id="line-146"></span><span class="hs-comment">{-
Should {\em fail} if @e@ returns @D@
\begin{verbatim}
f x | p &lt;- e', let C y# = e, f y# = r1
    | otherwise          = r2
\end{verbatim}
-}</span><span>
</span><span id="line-153"></span></pre></body></html>